{% if user is not defined %}
   {% set user=request.user %}
{% endif %}

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>{{squad_site_name()}} - {% block page_title %}{% endblock %}</title>

    <link rel="shortcut icon" href="{{static('favicon.ico')}}"/>

    <link rel="stylesheet" href="{{static('bootstrap/css/bootstrap.css')}}">
    <link rel="stylesheet" href="{{static('bootstrap/css/bootstrap-theme.css')}}">
    <link rel="stylesheet" href="{{static('font-awesome/css/font-awesome.css')}}">
    <link rel="stylesheet" href="{{static('main.css')}}">
    {% block styles %}{% endblock %}

  </head>

  <body>

    <div id='wrapper'>
    <nav id='navbar' class="navbar navbar-default">
      <div class="container container-fluid">
        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
        <a class="btn btn-navbar navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </a>
        <div class="navbar-header">
          <a class="navbar-brand" href="/">
            <img style="height: 27px;" src="{{static('squad_sign.svg')}}" alt='{{squad_site_name()}}'>
          </a>
        </div>

        <ul class="nav navbar-nav collapse navbar-collapse">
          <li class="{{active('home')}}"><a href="{{url('home')}}">{{ _('Groups') }}</a></li>
          <li class="dropdown">
            <a class="dropdown-toggle" href="#" id="compareDropdown" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
              {{ _('Compare') }}
              <span class="caret"></span>
            </a>
            <ul id="compare-menu" class="dropdown-menu" aria-labelledby="compareDropdown">
              <li>
                  <a class="dropdown-item" href="{{url('compare_builds')}}">{{ _('Compare Builds') }}</a>
              </li>
              <li role="separator" class="divider"></li>
              <li>
                  <a class="dropdown-item" href="{{url('compare_projects')}}">{{ _('Compare Projects') }}</a>
              </li>
              <li role="separator" class="divider"></li>
              <li>
                  <a class="dropdown-item "href="{{url('compare_test')}}">{{ _('Compare Test') }}</a>
              </li>
            </ul>
          </li>
          <li class="{{active('api-root')}}"><a href="{{url('api-root')}}">{{ _('API') }}</a></li>
        </ul>

        <ul class="nav navbar-nav collapse navbar-collapse navbar-right">
          {% include "squad/_user_menu.jinja2" %}
        </ul>

      </div>
    </nav>

    <div id="main-content">
      <div class="container">
        {% block content %}{% endblock %}
      </div>
    </div>

    <footer id='footer'>
      <div class="container">
        {{ (_('<a href="http://squad.readthedocs.io/">SQUAD</a> version %(squadversion)s.') % {'squadversion': squad_version()}) | safe }}
        {{ _('SQUAD is free software, distributed under the terms of <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU General Public License, version 3</a> or (at your option) any later version.') | safe }}
        {{ _('<a href="https://github.com/Linaro/squad">Source code</a> and <a href="https://github.com/Linaro/squad/issues">Issue tracker</a> are available on Github.') | safe }}
      </div>
    </footer>
    </div><!-- id="wrapper" -->

    <script type="text/javascript" src="{{static("jquery.js")}}"></script>
    <script type="text/javascript" src="{{static("bootstrap/js/bootstrap.js")}}"></script>
    <script type="text/javascript" src="{{static("angularjs/angular.min.js")}}"></script>
    <script type="text/javascript" src="{{static("lodash.js")}}"></script>
    <script type="text/javascript" src="{{static("floatThead/dist/jquery.floatThead.js")}}"></script>
    <script type="text/javascript" src="{{static("squad/common.js")}}"></script>
    <script type="text/javascript">
        csrf_token = '{{ csrf_token }}'
        user = '{{request.user}}'
    </script>
    {% block javascript %}{% endblock %}
  </body>
</html>

